<%- include header.ejs%>


<div style="width: 65%;float: left">
    <form>
        <select name="language" style="width:13%;margin-top: 45px;" onchange="submit(this);">
            <option value=""><%= __('active').lan%></option>
            <% plateDatas.forEach(function(plateData,index){%>
                <% if(language==plateData.platename){%>
                    <option value="<%- plateData.platename%>" selected="selected"><%- plateData.platename%></option>
                <%}else{%>
                    <option value="<%- plateData.platename%>"><%- plateData.platename%></option>
                <%}%>
            <% })%>
        </select>
        <!--<div class="circular" style="background: #fd9b05;width: 13%;height: 30px;float: right;margin-top: 45px;text-align: center">-->
            <!--<span style="line-height: 30px"><a target="_blank" href="/addActive" style="font-size: 14px;text-decoration : none;color: #606060">发起活动</a></span>-->
        <!--</div>-->
    </form>

    <% if(datas.length==0){%>
    <div class="circular" style="height:200px;background-color: white;border: 1px solid #ffffff;margin-top: 20px;padding: 20px;text-align: center">
        <div style="color: #000000;margin-top: 20px;font-size: large;line-height: 150px"><%= __('findPartner').hint %>!!!</div>
    </div>
    <%}else{%>
        <% datas.forEach(function(data,index){ %>
        <div class="circular" style="word-wrap:break-word;background-color: white;border: 1px solid #ffffff;margin-top: 20px;padding: 20px">
            <span><h3 style="display: inline"><b><a href="/activeParticulars?id=<%- data._id %>" target="_blank"><%- data.theme %></a></b></h3></span>
            <span style="float: right;padding-top: 10px"><%- data.activeDate %><span style="color: #d30000;font-size: small"> <b><%- data.addr %></b></span></span>

            <div style="color: #000000;margin-top: 20px;font-size: large"><%- data.intro %></div>
        </div>
        <% }) %>
    <%}%>
</div>
<div  style="width: 27%;float: left;margin-left: 3%;margin-top: 50px">
    <div class="circular" style="padding: 3%;height: 250px;background-color: white;">
        <h4><span style="font-size: larger"><%= __('active').regular%></span></h4>
        <% users.forEach(function(user,index){%>
        <div style="width: 20%;float: left;text-align: center;margin-left: 2%;margin-top: 10px">
            <img class="img-rounded" src="<%-user.headSrc%>" style="width: 59px;height: 59px">
            <span style="display: block"><a href="/partnerCenter?username=<%- user.username %>"><%- user.nickname %></a></span>
        </div>
        <%})%>
    </div>
    <!--<div class="circular" style="padding: 3%;background-color: white;margin-top: 40px">-->
        <!--<h3 style="margin-bottom: 50px"><span style="font-size: larger;color: #979797;">论坛最热活动</span></h3>-->
        <!--<% hotActives.forEach(function(hotActive,index){%>-->
            <!--<div style="float: left;width: 20%">-->
                <!--<img class="img-rounded" src="<%-hotActive.poster%>" style="width: 53px;height: 53px">-->
            <!--</div>-->
            <!--<div style="float: left;width: 70%">-->
                <!--<span style="font-size: large;line-height: 30px"><a href="/activeParticulars?id=<%- hotActive._id %>" target="_blank"><%-hotActive.theme%></a></span><br>-->
                <!--<span style="font-size: small;color:#d30000 "><b>已报名人数:<%-hotActive.applyNum%></b></span>-->
            <!--</div>-->
            <!--<div style="clear: both"></div>-->
            <!--<hr style="border: 1px dotted #979797">-->
        <!--<%})%>-->
    <!--</div>-->

</div>
<div style="clear: both"></div>
<div class="span12" style="margin-top: 50px">
    <div id="page1"></div>
</div>
<%- include footer.ejs%>
<script>
    function submit(obj){
        obj.submit();
    }
    function test(){
//        alert($(window).height())       //可见区域高度
//        alert($(window).width())        //可见区域宽度
//        alert($(document).height())     //整个页面高度
//        alert($(document).width())      //整个页面宽度
        alert($(document).scrollTop())  //获取滚动条到顶部的垂直高度
    }
    $(function(){
        //获得浏览器参数

        $.extend({
            getUrlVars: function(){
                var vars = [];
                var hash;
                var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
                console.log(hashes);
                for(var i = 0; i < hashes.length; i++){
                    hash = hashes[i].split('=');
                    vars.push(hash[0]);
                    vars[hash[0]] = hash[1];
                }
                return vars;
            },
            getUrlVar: function(name){
                return $.getUrlVars()[name];
            }
        });

        //封装浏览器参数
        var composeUrlParams=function(){
            var param='';
            $.each($.getUrlVars(), function(i, item) {
                if(item!='num'){
                    var val=$.getUrlVar(item);
                    if(val) param += "&" + item+"="+val;
                }
            });
            return param;
        }
        var options = {
            currentPage:<%- page.num %>,                //当前页，css样式同其他页不同
            totalPages:<%- page.pageCount %>,           //总页数
            numberOfPages:5,                            //导航最多显示页数
            pageUrl: function(type, page, current) {    //页面跳转
                if(page!=<%- page.num %>){
                    return "/active?num="+ page+composeUrlParams();
                }

            }
        }
        $('#page1').bootstrapPaginator(options);
    })
</script>